/**
 * 作者：陈文斌 on 2019/1/7.
 * 邮箱：chen_wennbin@163.com
 * 版本：v1.0
 */

import 'package:flutter/material.dart';
import 'package:crm/constant/constant.dart';
import 'package:crm/view/Tile/list_tile_normal.dart';
import 'package:crm/page/VisitorRecord/visitor_record_page.dart';
import 'package:crm/page/MarketSituation/market_situation_page.dart';
import 'package:crm/page/Feedback/user_feedback_record_page.dart';
import 'package:crm/page/PainPoint/pain_point_record_page.dart';

class ClientMaterialTileSection extends StatefulWidget {
  final String customerId;
  final String customerName;
  final int customerType;

  @override
  ClientMaterialTileSection({
    Key key,
    this.customerId,
    this.customerName,
    this.customerType,
  }) : super(key: key);

  State<StatefulWidget> createState() => _ClientMaterialTileSection();
}

class _ClientMaterialTileSection extends State<ClientMaterialTileSection> {
  final TextStyle _textStyle = TextStyle(
    color: AppColors.DetailTextColor,
    fontSize: AppFontSizes.Font15,
    fontFamily: AppFontFamilies.PingFangSC,
    fontWeight: FontWeight.w500,
  );

  @override
  Widget build(BuildContext context) {
    return Container(
      child: Column(
        children: <Widget>[
          ListTileNormal(
            leading: Icon(
              Icons.send,
              size: 20,
            ),
            title: Text(
              '拜访记录',
              style: _textStyle,
            ),
            onTap: () {
              print('拜访记录');
              Navigator.push(
                context,
                MaterialPageRoute(
                  builder: (context) => VisitorRecordPage(
                        customerId: widget.customerId,
                        customerName: widget.customerName,
                      ),
                ),
              );
            },
          ),
          ListTileNormal(
            leading: Icon(
              Icons.send,
              size: 20,
            ),
            title: Text(
              '提醒事项',
              style: _textStyle,
            ),
            onTap: () {
              print('提醒事项');
            },
          ),
          Offstage(
            offstage: widget.customerType == 0 ? false : true,
            child: ListTileNormal(
              leading: Icon(
                Icons.send,
                size: 20,
              ),
              title: Text(
                '用户反馈',
                style: _textStyle,
              ),
              onTap: () {
                print('用户反馈');
                Navigator.push(
                  context,
                  MaterialPageRoute(
                    builder: (context) => UserFeedbackRecordPage(
                          customerId: widget.customerId,
                          customerName: widget.customerName,
                        ),
                  ),
                );
              },
            ),
          ),
          Offstage(
            offstage: widget.customerType == 0 ? true : false,
            child: ListTileNormal(
              leading: Icon(
                Icons.send,
                size: 20,
              ),
              title: Text(
                '沟通记录',
                style: _textStyle,
              ),
              onTap: () {
                print('沟通记录');
              },
            ),
          ),
          Offstage(
            offstage: widget.customerType == 0 ? true : false,
            child: ListTileNormal(
              leading: Icon(
                Icons.send,
                size: 20,
              ),
              title: Text(
                '客户痛点',
                style: _textStyle,
              ),
              onTap: () {
                print('客户痛点');
                Navigator.push(
                  context,
                  MaterialPageRoute(
                    builder: (context) =>
                        PainPointRecordPage(customerId: widget.customerId),
                  ),
                );
              },
            ),
          ),
          Offstage(
            offstage: widget.customerType == 0 ? true : false,
            child: ListTileNormal(
              leading: Icon(
                Icons.send,
                size: 20,
              ),
              title: Text(
                '兴趣产品',
                style: _textStyle,
              ),
              onTap: () {
                print('兴趣产品');
              },
            ),
          ),
          ListTileNormal(
            leading: Icon(
              Icons.send,
              size: 20,
            ),
            title: Text(
              '市场方向',
              style: _textStyle,
            ),
            onTap: () {
              print('市场方向');
              Navigator.push(
                context,
                MaterialPageRoute(
                  builder: (context) => MarketSituationPage(),
                ),
              );
            },
          ),
          Offstage(
            offstage: widget.customerType == 0 ? false : true,
            child: ListTileNormal(
              leading: Icon(
                Icons.send,
                size: 20,
              ),
              title: Text(
                '潜在客户时的资料',
                style: _textStyle,
              ),
              onTap: () {
                print('潜在客户时的资料');
              },
            ),
          ),
          Offstage(
            offstage: widget.customerType == 0 ? true : false,
            child: ListTileNormal(
              leading: Icon(
                Icons.send,
                size: 20,
              ),
              title: Text(
                '转换为正式客户',
                style: _textStyle,
              ),
              onTap: () {
                print('转换为正式客户');
              },
            ),
          ),
          Padding(padding: EdgeInsets.only(bottom: 44)),
        ],
      ),
    );
  }
}
